package com.cj.st.web;

import com.cj.st.sevice.FileService;
import com.cj.st.util.ReturnT;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("file")
public class FileController {

    @Autowired
    private FileService fileService;

    /*
    文件上传
    */
    @ApiOperation(value = "文件上传", notes = "文件上传接口")
    @PostMapping("/upload")
    @RequiresPermissions("file:upload")
    public ReturnT upload(HttpServletRequest request) {
        return fileService.multiUploads(request);
    }
}
